<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    url: String,
  },
});
</script>

<template>
  <view class="video-poster">
    <image class="video-poster-img" :src="url" mode="aspectFill" />

    <view class="video-poster-wrapper">
      <view class="video-poster-add">
        <view class="video-poster-horizontal"></view>
        <view class="video-poster-vertical"></view>
      </view>
      <view class="video-poster-text">添加封面</view>
    </view>
  </view>
</template>

<style lang="scss">
.video-poster {
  position: relative;

  .video-poster-img {
    display: block;
    width: 192rpx;
    height: 256rpx;
    border-radius: 20rpx;
    filter: blur(2rpx);
  }

  .video-poster-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    border-radius: 20rpx;
    background-color: rgba(0, 0, 0, 0.2);
  }

  .video-poster-add {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28rpx;
    height: 28rpx;
    border-radius: 50%;
    border: 2rpx solid #ffffff;
  }

  .video-poster-horizontal,
  .video-poster-vertical {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16rpx;
    height: 2rpx;
    border-radius: 2rpx;
    background-color: #ffffff;
    transform: translate(-50%, -50%);
  }

  .video-poster-vertical {
    width: 2rpx;
    height: 16rpx;
  }

  .video-poster-text {
    margin-top: 10rpx;
    font-size: 24rpx;
    color: #ffffff;
    line-height: 34rpx;
    font-weight: bold;
  }
}
</style>